<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../libs/vue.js"></script>
</head>

<body>
    <div id="app">
        <!-- 调用 -->
        <myitem></myitem>
        <my-header></my-header>
    </div>
    <template id="header">
        <div>
            <h3>我是头部</h3>
        </div>
    </template>
    <script>
        let myHeader = {
            template: '#header',
            data() {
                return {
                    str: '我是头部数据'
                }
            },
            methods: {

            },
            computed: {

            }
        }

        let vm = new Vue({
            el: '#app',
            data: {

            },
            filters: {

            },
            // 私有组件注册
            components: {
                myitem: {
                    template: `
                        <h1>私有组件--{{msg}}</h1>
                    `,
                    data() {
                        return {
                            msg: '我是myitem的内容'
                        }
                    }
                },
                // 注册
                myHeader
            }
        })
    </script>
</body>

</html>